package bingo.codeweaver.view;

import java.util.HashMap;
import java.util.Map;

import bingo.codeweaver.view.utils.HtmlBuilder;

/**
 * 
 * May 28, 2009 7:46:48 AM
 * Author:yangdongyu(yangdy@bingosoft.net)
 * ReadMe:
 * ChangeLog:
 */
public abstract class AbstractComponent implements IComponent {

	private Map<String,Object> attributes = new HashMap<String, Object>();
	private HtmlBuilder viewBuilder = new HtmlBuilder();

	public AbstractComponent(){

	}


	public abstract String render();

	/**
	 * 
	 * @param key
	 * @param value
	 */
	public AbstractComponent addAttribute(String key, Object value){
		attributes.put(key, value);
		return this;
	}


	protected HtmlBuilder getViewBuilder() {
		return viewBuilder;
	}

}